/**
 * Created by wyy on 17-7-18.
 */

angular.module('tribalc').factory('dataPicker', ['$http', '$q', function ($http, $q) {
    return {
        query: function () {
            var lengthYear=30;
            var dataPicker={
                month:[],
                year:[],
                day:[]
            };
            var data = new Date();
            var nowyear = '2030';
            for(var i=nowyear,j=0; i > nowyear-lengthYear;i--,j++){
                dataPicker.year[j]=i;
                console.log(j)
            }
            for(var i=0;i<=11;i++){
                if(i<9){
                    dataPicker.month[i]='0'+(i+1);
                }else{
                    dataPicker.month[i]=String(i+1);
                }
            }
            return dataPicker;
        }
    }
}])